/**
 * 测试双向绑定
 */

import useReactive from "@/hooks/useReactive";
import { Button } from "antd";
import React from "react";

interface StateProps {
  name: string;
  age: number;
}

const UseReactive: React.FC = () => {
  const state = useReactive<StateProps>({ name: "小徐", age: 28 });

  return (
    <div style={{ padding: 20 }}>
      <h3>基本使用</h3>
      <p>姓名:{state.name}</p>
      <p>年龄:{state.age}</p>
      <Button onClick={() => state.age++}>age+1</Button>
    </div>
  );
};
export default UseReactive;
